package org.chenzhi.allinpaymvp;

import android.widget.Toast;

import org.chenzhi.allinpaymvp.mvp.presenter.SimplePresenter;
import org.chenzhi.allinpaymvp.mvp.view.SimpleView;
import org.chenzhi.mvp.activity.BaseMVPActivity;

public class SimpleActivity extends BaseMVPActivity<SimpleView, SimplePresenter> implements SimpleView {
    @Override
    public int getLayoutId() {
        return R.layout.activity_simple;
    }

    @Override
    public void init() {
        super.init();

        setClick(R.id.calc);
    }

    @Override
    protected SimplePresenter getPresenter() {
        return new SimplePresenter();
    }

    @Override
    public void processClick(int resId) {
        switch (resId) {
            case R.id.calc:
                mPresenter.calc();
                break;
        }
    }

    @Override
    public String getYear() {
        return getContent(R.id.year);
    }

    @Override
    public void showMsg(String msg) {
        Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
    }
}
